package com.lvtu.monitor.shiro;

import org.apache.shiro.SecurityUtils;

/**
 * Created by lvzimin on 16/3/14.
 */
public class UserUtils {

    /**
     * 获取当前线程用户登录名
     * @return
     */
    public static String getUserName() {
        if (null != SecurityUtils.getSubject()) {
            return (String)SecurityUtils.getSubject().getPrincipal();
        }
        return null;
    }
}
